package com.rockcent.mall.lib.domain;

import com.rockcent.common.domain.IDEntityMall;
import com.rockcent.mall.lib.domain.enumclass.EmailTemplateCode;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

import javax.persistence.*;

/**
 * Created by oyhk on 16/7/13.
 */
@Entity
@Table(name = "email_template")
@DynamicInsert(value = true)
@DynamicUpdate(value = true)
public class EmailTemplate extends IDEntityMall {

    @Enumerated(EnumType.STRING)
    @Column(columnDefinition = "varchar(30) comment '模板编码(SITE_REGISTER(\"官网邮件注册\"))'")
    private EmailTemplateCode code;
    @Column(columnDefinition = "varchar(255) comment '邮件标题'")
    private String title;
    @Column(columnDefinition = "text comment '邮件内容'")
    private String content;
    @Column(columnDefinition = "varchar(100) comment '发送者'")
    private String sender;

    public EmailTemplateCode getCode() {
        return code;
    }

    public void setCode(EmailTemplateCode code) {
        this.code = code;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public String getSender() {
        return sender;
    }

    public void setSender(String sender) {
        this.sender = sender;
    }

    @Override
    public String toString() {
        return "EmailTemplate{" +
                "code=" + code +
                ", id=" + id +
                ", title='" + title + '\'' +
                ", dateCreated=" + dateCreated +
                ", content='" + content + '\'' +
                ", sender='" + sender + '\'' +
                ", lastUpdated=" + lastUpdated +
                ", isDelete=" + isDelete +
                ", version=" + version +
                '}';
    }
}
